﻿@{
    Layout = null;
}
@model ElingOA6_Admin_DSJCJ.Model.HRWorkGrpMember
<!DOCTYPE html>

<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title>GroupEmplEdit</title>
            @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/PageCommon.js", true)" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>
       <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    <script>

     $(document).ready(function () {
            $("#toolMenu").smartFloat();
            var hdjsAlert = $("#hdjsAlert").val();
            if (hdjsAlert != "") {
                alert(hdjsAlert);
            }
        });
        //员工选择确定
        function EmpOK(id,name) {
            $("#hbFEmplNo").val(id);
            var clientFEmpNameObj = ASPxClientButtonEdit.Cast("FEmpName");
            clientFEmpNameObj.SetText(name);
            pcModalMode.Hide();
        }

       function FEmplNo_ButtonClick(s, e) {
            pcModalMode.Show();
            
        }

         //员工选择取消
        function EmpCancel() {
            pcModalMode.Hide();
        }

        function save() {
            form1.submit();
        }

        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnSave":
                    {
                        //保存
                        save();
                        break;
                    }
                case "btnCancel":
                    {
                        //密码重置
                        window.location.href = rootPath + "/Admin/Group/GroupEmplList?type=group&gNo=" + $("#hbgNo").val();
                        break;
                    }
            }
        }

    </script>

        
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
</head>
<body>
@using (Html.BeginForm("SaveGroupEmpl", "Group", FormMethod.Post, new { id = "form1" }))
{ 
        <div class="floatToolMenu" id="toolMenu">
            @Html.DevExpress().Menu(settings =>
      {
          settings.Name = "toolBarMenu";
          settings.ItemAutoWidth = false;
          settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
          settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
          settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);

          settings.Items.Add(item =>
          {
              item.Name = "btnSave";
              item.Text = "保存";
              item.ClientEnabled = true;
              item.Image.Url = Url.Content("~/Content/ControlImages/filesave.png");

          });
          settings.Items.Add(item =>
          {
              item.Name = "btnCancel";
              item.Text = "取消";
              item.ClientEnabled = true;
              item.Image.Url = Url.Content("~/Content/ControlImages/no.png");

          });
          settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
          settings.ItemLinkMode = ItemLinkMode.ContentBounds;
      }).GetHtml()
        </div>
    <div class="div">
        <table width="100%" align="center" class="tableForm">
            <tr>
                <td colspan="2" style="font-weight:bolder; font-size:larger; text-align:center">工作组成员添加</td>
            </tr>
            <tr>
                <th width="20%" >工作组成员:</th>
                <th width="80%" style=" text-align : left">
                           
                        @Html.DevExpress().ButtonEdit(settings =>
                   {
                       settings.Text = Model.FEmpName;
                       settings.Name = "FEmpName";
                       settings.Width = System.Web.UI.WebControls.Unit.Percentage(96);
                       settings.ReadOnly = true;
                       if ((bool)ViewData["isVisible"] == true)
                       {
                           settings.Properties.Buttons.Add("选择");
                           settings.Properties.ClientSideEvents.ButtonClick = "FEmplNo_ButtonClick";
                       }
                       
                       settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyValidation(s,e,'对应员工')}";
                   }).GetHtml()
                   
                </th>
            </tr>
            <tr>
                <th >工作组职务:</th>
                <th style=" text-align : left">
               @Html.DevExpress().ComboBox(settings =>
               {
                   settings.Width = 170;
                   settings.Name = "FWorkGrpDutyNo";
                   settings.Properties.TextField = "FDutyName";
                   settings.Properties.ValueField = "FWorkGrpDutyNo";
                   settings.Properties.DropDownStyle = DropDownStyle.DropDownList;

               }).BindList(ViewData["HRWorkGrpDutyList"]).Bind(Model.FWorkGrpDutyNo).GetHtml()
                </th>
            </tr>
            <tr>
                <th >工作职责:</th>
                <th style=" text-align : left">
                                @Html.DevExpress().Memo(settings =>
          {
              settings.Name = "FWorkDuty";
              settings.Width = System.Web.UI.WebControls.Unit.Percentage(96);
              settings.Text = Model.FWorkDuty;
          }).GetHtml()
                    
                </th>
            </tr>
            <tr>
                <th >显示顺序:</th>
                <th style=" text-align : left">
                                             @Html.DevExpress().TextBox(settings =>
          {
              settings.Name = "FSeq";
              settings.Width = System.Web.UI.WebControls.Unit.Percentage(96);
              settings.Text = Model.FSeq.ToString();
          }).GetHtml()
                </th>
            </tr>
        </table>
    </div>
            @Html.Hidden("hdMethod", ViewData["hdMethod"]);
        @Html.Hidden("hdjsAlert", (ViewData["jsAlert"]));
         @Html.Hidden("hbFEmplNo",Model.FEmplNo);
         @Html.Hidden("hbgNo", ViewData["gNo"]);                               
                                           
    
      @Html.DevExpress().PopupControl(
    settings =>
    {
        settings.Name = "pcModalMode";
        settings.Width = 300;
        settings.Height = 430;
        settings.AllowDragging = true;
        settings.CloseAction = CloseAction.CloseButton;
        settings.EnableAnimation = false;
        settings.HeaderText = "人员选择";
        settings.Modal = true;
        settings.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
        settings.PopupVerticalAlign = PopupVerticalAlign.WindowCenter;
        settings.ShowFooter = true;
        settings.SetFooterTemplateContent(s =>
        {
            ViewContext.Writer.Write("<table align='center'><tr><td>");
            @Html.DevExpress().Button(footBtnSettings =>
            {
                footBtnSettings.Name = "btnOK";
                footBtnSettings.Text = "确定";
                footBtnSettings.ClientSideEvents.Click = "function(s,e){popContent.OK()}";
                footBtnSettings.Images.Image.Url = Url.Content("~/Content/ControlImages/ok.png");
                footBtnSettings.CausesValidation = false;
            }).GetHtml();
            ViewContext.Writer.Write("</td><td>");
            @Html.DevExpress().Button(footBtnSettings =>
            {
                footBtnSettings.Name = "btnCancel";
                footBtnSettings.Text = "取消";
                footBtnSettings.ClientSideEvents.Click = "function(){EmpCancel();}";
                footBtnSettings.Images.Image.Url = Url.Content("~/Content/ControlImages/no.png");
                footBtnSettings.CausesValidation = false;
            }).GetHtml();
            ViewContext.Writer.Write("</td></tr></table>");

        });
        settings.SetContent(() =>
        {
            ViewContext.Writer.Write("<iframe  id='popContent' name='popContent' style='width:100%;height:330px' frameborder='0' src='" + Url.Action("EmplTree", "Group") + "'></iframe>");
        });


    }).GetHtml()
}
    <script>
        lp.Hide();
    </script>
</body>
</html>
